﻿@using QuanLyHocSinh.Models
@model LoginViewModel
@{
    ViewBag.Title = "Đăng nhập";
    Layout = "~/Views/Shared/UserLayout.cshtml";
}

<h2>Đăng nhập</h2>
<div class="row">
    <div class="col-md-8">
        <section id="loginForm">
            @using (Html.BeginForm("Login", "Account", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
            {
                @Html.AntiForgeryToken()
                <h4>Tài khoản quản trị</h4>
                <hr />
                @Html.ValidationSummary(false, "", new { @class = "text-danger" })
                <div class="form-group">
                    @Html.LabelFor(m => m.UserName, new { @class = "col-md-2 control-label" })
                    <div class="col-md-10">
                        @Html.TextBoxFor(m => m.UserName, new { @class = "form-control", required = "" })
                        @Html.ValidationMessageFor(m => m.UserName, "", new { @class = "text-danger" })
                    </div>
                </div>
                <div class="form-group">
                    @Html.LabelFor(m => m.Password, new { @class = "col-md-2 control-label" })
                    <div class="col-md-10">
                        @Html.PasswordFor(m => m.Password, new { @class = "form-control", required = "" })
                        @Html.ValidationMessageFor(m => m.Password, "", new { @class = "text-danger" })
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-offset-2 col-md-10">
                        <div class="checkbox">
                            @Html.CheckBoxFor(m => m.RememberMe)
                            @Html.LabelFor(m => m.RememberMe)
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-offset-2 col-md-10">
                        <input type="submit" value="Đăng nhập" class="btn btn-primary" />  
                        <input type="button" value="Đăng ký" onclick="DangKy()" class="btn btn-default"/>
                    </div>
                </div>
                
                @*Enable this once you have account confirmation enabled for password reset functionality*@
                @*<p>
                    @Html.ActionLink("Forgot your password?", "ForgotPassword")
                </p>*@
            }
        </section>
    </div>
    @*<div class="col-md-4">
        <section id="socialLoginForm">
            @Html.Partial("_ExternalLoginsListPartial", new ExternalLoginListViewModel { ReturnUrl = ViewBag.ReturnUrl })
        </section>
    </div>*@
</div>
@section Scripts{
    <script type="text/javascript">
        function DangKy() {
            window.location.href = '@Url.Action("Register")';
        }
    </script>
}